package com.itheima.stream流.实例;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Demo7 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"杨过=小龙女","尹志平=小龙女","郭靖=黄蓉");
        Map<String, String> stringMap = list.stream().filter(s -> s.split("=")[1].equals("小龙女")).collect(Collectors.toMap(s -> s.split("=")[0], s -> s.split("=")[1]));
        System.out.println(stringMap);
        System.out.println("..........................");

    }
}
